﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace Zj.DDDSample.Domain.Events
{
    /// <summary>
    /// Message serializer interface.
    /// </summary>
    public interface IMessageSerializer
    {
        Task<byte[]> SerializeAsync<TEvent>(TEvent @event)
             where TEvent : IEvent;

        Task<TEvent> DeSerializeAsync<TEvent>(byte[] message)
            where TEvent : IEvent;
    }
}
